package leetcode_1401_1500;

public class LeeCode_1401 {
    public static void main(String[] args) {

    }
    private static boolean checkOverlap(int radius, int xCenter, int yCenter, int x1, int y1, int x2, int y2) {
        if (xCenter >= x1 && xCenter <= x2 && yCenter <= y2 + radius && yCenter >= y2){
            return true;
        }
        if (xCenter >= x1 && xCenter <= x2 && yCenter >= y1 - radius && yCenter <= y1){
            return true;
        }
        if (yCenter >= y1 && yCenter <= y2 && xCenter >= x1 - radius && xCenter <= x1){
            return true;
        }
        if (yCenter >= y1 && yCenter <= y2 && xCenter >= x2 && xCenter <= x2 + radius){
            return true;
        }
        if (Math.pow(xCenter - x1, 2) + Math.pow(yCenter - y1, 2) <= radius * radius){
            return true;
        }
        if (Math.pow(xCenter - x2, 2) + Math.pow(yCenter - y2, 2) <= radius * radius){
            return true;
        }
        if (Math.pow(xCenter - x1, 2) + Math.pow(yCenter - y2, 2) <= radius * radius){
            return true;
        }
        if (Math.pow(xCenter - x2, 2) + Math.pow(yCenter - y1, 2) <= radius * radius){
            return true;
        }
        if (xCenter >= x1 && xCenter <= x2 && yCenter >= y1 && yCenter <= y2){
            return true;
        }
        return false;
    }
}